#include <iostream>

unsigned long fact1(unsigned long f)
{
	if(f<=1)
		return 1;
	else
		return f * fact1(f-1);
}

unsigned long fact2(unsigned long f)
{
	unsigned long rezult=1;
	for(unsigned long i=f;i>=1;--i)
		rezult*=i;
	return rezult;
}

int main()
{
	std::cout << "nermuceq tiv: ";
	unsigned long f=0;
	std::cin >> f;
	std::cout << "rekursiv tarberakov: " << f << "! = " << fact1(f) << "\n";
	std::cout << "iterativ tarberakov: " << f << "! = " << fact2(f) << "\n";
	return 0;
}